package com.n9.buymsg.start;

import com.n9.buymsg.service.ConfigService;
import com.n9.buymsg.view.LoginForm;
import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;

/**
 * 程序启动方法
 * @author ice
 * @since 2019/1/29 15:34
 */
public class Launcher {
    public static void main(String[] args) throws Exception {
        Initializer.init();
        BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
        BeautyEyeLNFHelper.launchBeautyEyeLNF();

        new ConfigService().loadConfig();

        LoginForm loginForm = new LoginForm();
        loginForm.setVisible(true);


//        LoginForm loginForm = new LoginForm((user)->{
//            new UserService().saveOrUpdate(user);
//
//            //显示主窗口
//            FormService formService = new FormService();
//            formService.initView();
//            formService.openMainForm();
//        });
//        loginForm.setVisible(true);
//        User user = new UserService().getUser();
//        if (Objects.nonNull(user)) {
//            loginForm.setUser(user);
//        }
    }
}
